\b0 to get the global window numbers for all of the windows on the screen. Then, I pass the window numbers to
\b PScurrentwindowbounds
\b0 to get the size of each window. However, I'm getting DPS errors. What am I doing wrong?\
\
A: There are many PostScript wraps that require
\i userobjects
\i0 for arguments which represent windows—
\b PScurrentwindowbounds
\b0 is one of these. There are many other PostScript wraps which return values that represent windows whose type is an integer—
\b PSscreenlist
\b0 is one of these. Thus the return values that you get from
\b PSscreenlist
\b0 cannot serve directly as arguments for
\b PScurrentwindowbounds
\b0 .\
\
You must either convert non-userobjects to a userobject before passing it to the next PostScript operator, or you must write your own wrap which takes window arguments as a type int. In the example stated in the question above it would be best to write your own wrap to replace
\b PScurrentwindowbounds
\b0 .\
\
It would look like this:\
\f3\fs22 \
\pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220 defineps MYcurrentwindowbounds(int num | float *x, *y, *w, *h)\
\pard\tx620\tx1240\tx1860\tx2480\tx3100\tx3720\tx4340\tx4980\tx5600\tx6220\fc0 You can also create a userobject using
\b DPSDefineUserObject()
\b0 to pass into the wrap. However, you should only make a userobject if you are going to use it several times in your program. Remember when using
\b DPSDefineUserObject
\b0 to pass it an index of 0. This indicates to the client library to return the next available userobject. If you pass it a value of your own choosing, you may clobber one that already exists.\
\
\pard\tx1340\tx2680\tx4020\tx5360\tx6720\tx8060\tx9400\tx10740\tx12080\tx13440\fc0 User objects are the numbers that you get in event records and when you ask a Window object for its number. Really they are more the rule than the exception.\